<?php

use think\migration\Seeder;

class SourcePollutantForecastConfigData extends Seeder
{
    public function run()
    {
        $table = $this->table('source_bureau_air_quality_pollutant_forecast_config');
        $config = [
            'station'   => ' ["CZBZ", "DSY", "JCZ", "QHZ", "SJJ"]',
            'pollutant' => '["no2", "SO2", "PM2_5"]',
            'industry'  => '["iron", "heating", "coking", "boiler", "cement_glass", "chemical_industry", "other_industry", "others", "resident", "transportation"]',
            'interval'  => '168',
        ];

        //结果：'{"station": ["CZBZ", "DSY", "JCZ", "QHZ", "SJJ"],"pollutant": ["no2", "SO2", "PM2_5"],"industry": ["iron", "heating", "coking", "boiler", "cement_glass", "chemical_industry", "other_industry", "others", "resident", "transportation"],"interval": 168}'
        $rows = [
            [
                'id'     => '1',
                'city'   => '长治',  //城市
                'config' => json_encode($config, true),   //配置,
            ],
        ];
        $table->insert($rows)->save();
    }
}
